1. Field of the Invention
This invention relates to a control unit for controlling a magnetic tape unit, and particularly to a control unit for a magnetic tape unit which makes trailer control by using a means for making compression and expansion of data, a means for making data blocking and a buffer.
2. Description of the Prior Art
Conventionally, the above type of control unit for a magnetic tape unit is used to control, for example, a streamer type magnetic tape unit. Because it takes time to accelerate and stop the tape of the magnetic tape unit, data is stored in a plural blocks within a buffer, then a tape speed is accelerated to continuously write in the plural blocks without stopping the tape as much as possible. Therefore, the termination report of write instruction from the host computer is sent when the storage into the buffer has been completed without being kept waiting until the transferred data is written in the magnetic tape.
But, even if the storage into the buffer has normally completed, it is not certain that the writing into the magnetic tape is normally made, and writing in the magnetic tape may fail due to some failure. In this case, the host computer has to recover the data from the buffer and execute the write instruction again using the recovered data.
For example, a magnetic tape controller which does not have a means for compressing data and a means to make auto-blocking of data recovers one block data corresponding to one write instruction from a buffer according to one data recovery instruction, recovers data until there remains no unwritten data in the buffer to temporarily store in the memory of the host computer, and tries to write again.
In this case, to retry with the host computer, a memory for recovering all unwritten data from the buffer and a record area for recording management information such as address and data length on the memory of each block recovered are needed.
Memory capacity for recovering all data from the buffer does not exceed the capacity of the buffer within the magnetic tape controller. Therefore the host computer can recover all data when it secures memory equalling buffer capacity at most. And, the memory area for storing management information is required to meet the block number to be recovered, but generally the control unit for the magnetic tape unit has a control memory for storing similar control information for data control within the buffer, and the block number to be stored in the buffer is limited to the number which can be managed by the control memory. Therefore, the host computer can recover the data of all buffers when it has control information area corresponding to the block number capable of being controlled by the magnetic tape controller.
Even a control unit for a magnetic tape unit provided with a means for compressing data and a means to make auto-blocking of data has a structure to recover the data for one block corresponding to one write instruction in the same way as above according to one recovery instruction.
But, such a conventional control unit for the magnetic tape unit with means for compressing data and means to make auto-blocking of data has a drawback. Specifically the host computer needs to secure a very large memory to recover, without expansion or decompression data compressed and stored within the buffer. Particularly, when the data compression ratio is high, memory becomes enormous and such a memory may be actually impossible to secure.
To make auto-blocking with the control unit for the magnetic tape unit, each logical block connected in the buffer is not managed, but a physical block unit having them connected is managed. Therefore, there is possibility that the number of logical blocks stored in the buffer becomes enormous. Therefore, when the logical blocks exceeding the number of blocks capable of being managed by the host computer are stored in the buffer, the host computer has a drawback that all data cannot be recovered.
If the host computer, when effecting retry, cannot recover the unwritten data, it cannot proceed processing, resulting in aborting. Retry of writing itself is not a rare matter. For example, in addition to a failure of a device, it occurs by a temporary write error due to defect in the magnetic tape or mingle of dust. Therefore, it becomes a serious problem when the continuous process becomes impossible due to the above and abortion is inevitable.